package com.aiti.lulian.mapper.newCard;

import com.aiti.lulian.dto.newCard.ExchangeCardParamDto;
import com.aiti.lulian.dto.newCard.MyCardHolderParamDto;
import com.aiti.lulian.dto.newCard.MyExchangeRequestPageParamDto;
import com.aiti.lulian.entity.newCard.CardUserExtraUnion;
import com.aiti.lulian.vo.newCard.ExchangeCardListVo;
import com.aiti.lulian.vo.newCard.MyCardHolderVo;
import com.aiti.lulian.vo.newCard.MyExchangeRequestVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CardExchangeMapper {

    Integer queryExchangeCount(@Param("dto")ExchangeCardParamDto dto);

    void saveExchangeRequest(@Param("dto")CardUserExtraUnion paramDto);

    void updateVisitorRecordExchangeStatus(@Param("fromUserId")String fromUserId, @Param("toUserId")String toUserId, @Param("cardId")String cardId, @Param("exchangeStatus")String exchangeStatus, @Param("visitorCardId")String visitorCardId);

    List<ExchangeCardListVo> queryExchangeCardList(@Param("userId")String userId);

    List<MyExchangeRequestVo> queryMyExchangeRequestList(@Param("userId")String userId);

    void updateEnableByBaseId(@Param("baseId")String baseId, @Param("enable")String enable);

    CardUserExtraUnion queryCardUserExtraUnionByBaseId(@Param("baseId")String baseId);

    List<MyExchangeRequestVo> queryMyExchangeRequestPageList(@Param("page") IPage<MyExchangeRequestVo> page, @Param("dto") MyExchangeRequestPageParamDto dto);

    Integer queryMyExchangeRequestCount(@Param("userId") String userId, @Param("enable") String enable);

    List<MyCardHolderVo> queryMyCardHolderList(@Param("page") IPage<MyCardHolderVo> page, @Param("dto") MyCardHolderParamDto dto);

    List<CardUserExtraUnion> queryExchangeList(@Param("dto")ExchangeCardParamDto dto);

    Integer queryMyCardCount(@Param("fromUserId") String fromUserId, @Param("toCardId") String toCardId);

    void deleteUserHolderCard(@Param("fromUserId") String fromUserId, @Param("toCardId") String toCardId);
}
